package chatdto

import (
	"github.com/gogf/gf/v2/util/gconv"
	"strconv"
	"xr-game-server/entity"
)

type ChatDto struct {
	RoleId   string `json:"roleId" dc:"聊天对象"`
	Nick     string `json:"nick" dc:"昵称"`
	AvatarId uint32 `json:"avatarId" dc:"头像id"`
	ServerId uint64 `json:"serverId" dc:"区服id"`
}

func NewChatDto(role *entity.PlayerRole) *ChatDto {
	ret := new(ChatDto)
	gconv.Struct(role, ret)
	ret.RoleId = strconv.FormatUint(role.ID, 10)
	return ret
}
